package com.project.poetry.service.entity.po.job;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.project.poetry.common.entity.BasePO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;

/**
 * @author mengxj
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("sys_job")
public class JobPO extends BasePO {

    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("job的id")
    private String jobId;

    @ApiModelProperty("spring bean的id")
    @NotBlank(message = "beanId 不能为空")
    private String beanId;

    private String beanName;

    @ApiModelProperty("方法名，与beanId结合能够确定唯一的具体方法")
    @NotBlank(message = "方法名 不能为空")
    private String methodName;

    private String params;

    @ApiModelProperty("job 的组")
    private String jobGroup;

    @ApiModelProperty("cron表达式")
    @NotBlank(message = "cron表达式 不能为空")
    private String cronExpression;

    @ApiModelProperty("功能描述")
    private String descriptor;
}
